using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_StackPanel_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.StackPanel);
            args = new Type[]{typeof(huqiang.Data.FakeStruct), typeof(huqiang.Core.HGUI.UIElement), typeof(huqiang.Core.HGUI.UIInitializer)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_0);
            args = new Type[]{};
            method = type.GetMethod("Order", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Order_1);
            args = new Type[]{typeof(System.Single)};
            method = type.GetMethod("Update", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Update_2);

            field = type.GetField("direction", flag);
            app.RegisterCLRFieldGetter(field, get_direction_0);
            app.RegisterCLRFieldSetter(field, set_direction_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_direction_0, AssignFromStack_direction_0);
            field = type.GetField("spacing", flag);
            app.RegisterCLRFieldGetter(field, get_spacing_1);
            app.RegisterCLRFieldSetter(field, set_spacing_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_spacing_1, AssignFromStack_spacing_1);
            field = type.GetField("FixedSize", flag);
            app.RegisterCLRFieldGetter(field, get_FixedSize_2);
            app.RegisterCLRFieldSetter(field, set_FixedSize_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_FixedSize_2, AssignFromStack_FixedSize_2);
            field = type.GetField("FixedSizeRatio", flag);
            app.RegisterCLRFieldGetter(field, get_FixedSizeRatio_3);
            app.RegisterCLRFieldSetter(field, set_FixedSizeRatio_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_FixedSizeRatio_3, AssignFromStack_FixedSizeRatio_3);
            field = type.GetField("ItemOffset", flag);
            app.RegisterCLRFieldGetter(field, get_ItemOffset_4);
            app.RegisterCLRFieldSetter(field, set_ItemOffset_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_ItemOffset_4, AssignFromStack_ItemOffset_4);
            field = type.GetField("AutoSize", flag);
            app.RegisterCLRFieldGetter(field, get_AutoSize_5);
            app.RegisterCLRFieldSetter(field, set_AutoSize_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_AutoSize_5, AssignFromStack_AutoSize_5);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.StackPanel());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.StackPanel[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Initial_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIInitializer @initializer = (huqiang.Core.HGUI.UIInitializer)typeof(huqiang.Core.HGUI.UIInitializer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Core.HGUI.UIElement @script = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Data.FakeStruct @mod = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.StackPanel instance_of_this_method = (huqiang.UIComposite.StackPanel)typeof(huqiang.UIComposite.StackPanel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Initial(@mod, @script, @initializer);

            return __ret;
        }

        static StackObject* Order_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.StackPanel instance_of_this_method = (huqiang.UIComposite.StackPanel)typeof(huqiang.UIComposite.StackPanel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Order();

            return __ret;
        }

        static StackObject* Update_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @time = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.StackPanel instance_of_this_method = (huqiang.UIComposite.StackPanel)typeof(huqiang.UIComposite.StackPanel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Update(@time);

            return __ret;
        }


        static object get_direction_0(ref object o)
        {
            return ((huqiang.UIComposite.StackPanel)o).direction;
        }

        static StackObject* CopyToStack_direction_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.StackPanel)o).direction;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_direction_0(ref object o, object v)
        {
            ((huqiang.UIComposite.StackPanel)o).direction = (huqiang.UIComposite.Direction)v;
        }

        static StackObject* AssignFromStack_direction_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.Direction @direction = (huqiang.UIComposite.Direction)typeof(huqiang.UIComposite.Direction).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            ((huqiang.UIComposite.StackPanel)o).direction = @direction;
            return ptr_of_this_method;
        }

        static object get_spacing_1(ref object o)
        {
            return ((huqiang.UIComposite.StackPanel)o).spacing;
        }

        static StackObject* CopyToStack_spacing_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.StackPanel)o).spacing;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_spacing_1(ref object o, object v)
        {
            ((huqiang.UIComposite.StackPanel)o).spacing = (System.Single)v;
        }

        static StackObject* AssignFromStack_spacing_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @spacing = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.StackPanel)o).spacing = @spacing;
            return ptr_of_this_method;
        }

        static object get_FixedSize_2(ref object o)
        {
            return ((huqiang.UIComposite.StackPanel)o).FixedSize;
        }

        static StackObject* CopyToStack_FixedSize_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.StackPanel)o).FixedSize;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_FixedSize_2(ref object o, object v)
        {
            ((huqiang.UIComposite.StackPanel)o).FixedSize = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_FixedSize_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @FixedSize = ptr_of_this_method->Value == 1;
            ((huqiang.UIComposite.StackPanel)o).FixedSize = @FixedSize;
            return ptr_of_this_method;
        }

        static object get_FixedSizeRatio_3(ref object o)
        {
            return ((huqiang.UIComposite.StackPanel)o).FixedSizeRatio;
        }

        static StackObject* CopyToStack_FixedSizeRatio_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.StackPanel)o).FixedSizeRatio;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_FixedSizeRatio_3(ref object o, object v)
        {
            ((huqiang.UIComposite.StackPanel)o).FixedSizeRatio = (System.Single)v;
        }

        static StackObject* AssignFromStack_FixedSizeRatio_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @FixedSizeRatio = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.StackPanel)o).FixedSizeRatio = @FixedSizeRatio;
            return ptr_of_this_method;
        }

        static object get_ItemOffset_4(ref object o)
        {
            return ((huqiang.UIComposite.StackPanel)o).ItemOffset;
        }

        static StackObject* CopyToStack_ItemOffset_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.StackPanel)o).ItemOffset;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_ItemOffset_4(ref object o, object v)
        {
            ((huqiang.UIComposite.StackPanel)o).ItemOffset = (System.Single)v;
        }

        static StackObject* AssignFromStack_ItemOffset_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @ItemOffset = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.StackPanel)o).ItemOffset = @ItemOffset;
            return ptr_of_this_method;
        }

        static object get_AutoSize_5(ref object o)
        {
            return ((huqiang.UIComposite.StackPanel)o).AutoSize;
        }

        static StackObject* CopyToStack_AutoSize_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.StackPanel)o).AutoSize;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_AutoSize_5(ref object o, object v)
        {
            ((huqiang.UIComposite.StackPanel)o).AutoSize = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_AutoSize_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @AutoSize = ptr_of_this_method->Value == 1;
            ((huqiang.UIComposite.StackPanel)o).AutoSize = @AutoSize;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.StackPanel();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
